package com.wc.codeforces.思维.MEX_Cycle;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/12/21 10:21
 * @description
 * https://codeforces.com/contest/2049/problem/C
 */
public class Main {
    /**
     * 思路:
     * x, y 本来就是好友
     * n 为偶数时候, 1 0 1 0 1 0 1 0, 满足条件
     * n 为奇数时候, 1 0 1 0 1 ... 1 0 2, 满足条件
     * x, y 本来不是好友
     * n 为偶数时候, a[x] != a[y] 就不用管, a[x] == a[y], 将其中一个改成 2, 就满足条件了
     * n 为奇数时候, a[x] != a[y] 就不用管, a[x] == a[y], 将不靠近 2 位置的改成 2, 就满足条件了
     *
     * 特殊情况： 当刚好是边界修改, 并且是奇数的情况, 例如 5 2 4
     * 会将 a[2] = 2, a[1] = 0, 并且 a[n] = 1
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 200010;
    static int[] a = new int[N];
    static int n, x, y;

    public static void main(String[] args) {
        int T = sc.nextInt();
        while (T-- > 0) {
            n = sc.nextInt();
            x = sc.nextInt();
            y = sc.nextInt();
            for (int i = 1; i <= n; i += 2) {
                a[i] = 1;
                a[i + 1] = 0;
            }
            if ((n & 1) == 1) a[n] = 2;
            a[n + 1] = -1;
            if (a[x] == a[y]) {
                if (a[y + 1] != 2) a[y] = 2;
                else a[x] = 2;
                // 特殊情况 5 2 4, 当刚好是边界修改, 并且是奇数的情况
                if (a[2] == 2 && (n & 1) == 1) {
                    a[1] = 0;
                    a[n] = 1;
                }
            }
            for (int i = 1; i <= n; i++) out.print(a[i] + " ");
            out.println();
        }
        out.flush();
    }
}


class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
